home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17429 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.1 KB  |  33 lines

  1. Path: news.belwue.de!uzwil!kuehl
  2. From: kuehl@uzwil.informatik.uni-konstanz.de (Dietmar Kuehl)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: bitfield
  5. Date: 15 Apr 1996 22:13:48 GMT
  6. Organization: FakultΣt fⁿr Mathematik und Informatik
  7. Message-ID: <4kuhms$2hg@news.BelWue.DE>
  8. References: <3172B547.1F54@braunschweig.netsurf.de>
  9. Reply-To: dietmar.kuehl@uni-konstanz.de
  10. NNTP-Posting-Host: uzwil.informatik.uni-konstanz.de
  11. X-Newsreader: TIN [version 1.2 PL2]
  12.  
  13. Hi,
  14. Dieter Lⁿcking (luecking@braunschweig.netsurf.de) wrote:
  15. :         struct BITS
  16. :         {
  17. :           int bits : 3;
  18. :         };
  19.  
  20. :         BITS array[8];
  21.  
  22. : How much memory needs array ?
  23.  
  24. This depends on the compiler and the platform's ABI. Maybe
  25. 'sizeof(BITS)' is '8' (if a 'struct' containing some data is allowed to
  26. be put into a 'char'; this is unlikely), or, which is more likely, '16'
  27. if 'sizeof(int) == 2' or '32' if 'sizeof(int) == 4' (if a 'struct' can
  28. be placed into an 'int').
  29. --
  30. dietmar.kuehl@uni-konstanz.de
  31. http://www.informatik.uni-konstanz.de/~kuehl/
  32. I am a realistic optimist - that's why I appear to be slightly pessimistic
  33.